// Created by plusminus on 17:41:55 - 16.10.2008
package com.talkweb.osmharmony.util.constants;

import com.talkweb.osmharmony.ResourceTable;

public interface GeoConstants {
    // ===========================================================
    // Final Fields
    // ===========================================================

    int RADIUS_EARTH_METERS = 6378137; // http://en.wikipedia.org/wiki/Earth_radius#Equatorial_radius
    double METERS_PER_STATUTE_MILE = 1609.344; // http://en.wikipedia.org/wiki/Mile
    double METERS_PER_NAUTICAL_MILE = 1852; // http://en.wikipedia.org/wiki/Nautical_mile
    double FEET_PER_METER = 3.2808399; // http://en.wikipedia.org/wiki/Feet_%28unit_of_length%29
    @Deprecated
    int EQUATORCIRCUMFENCE = (int) (2 * Math.PI * RADIUS_EARTH_METERS);

    /**
     * @since 6.1.1
     */
    enum UnitOfMeasure {
        meter(1, ResourceTable.String_format_distance_only_meter),
        kilometer(1000, ResourceTable.String_format_distance_only_kilometer),
        statuteMile(GeoConstants.METERS_PER_STATUTE_MILE, ResourceTable.String_format_distance_only_mile),
        nauticalMile(GeoConstants.METERS_PER_NAUTICAL_MILE, ResourceTable.String_format_distance_only_nautical_mile),
        foot(1 / GeoConstants.FEET_PER_METER, ResourceTable.String_format_distance_only_foot);

        private final double mConversionFactorToMeters;
        private final int mStringResId;

        UnitOfMeasure(final double pConversionFactorToMeters, final int pStringResId) {
            mConversionFactorToMeters = pConversionFactorToMeters;
            mStringResId = pStringResId;
        }

        public double getConversionFactorToMeters() {
            return mConversionFactorToMeters;
        }

        public int getStringResId() {
            return mStringResId;
        }
    }

    // ===========================================================
    // Methods
    // ===========================================================
}
